<template>
<div>
  <TabList @look='look' :list='records'></TabList>
  <PopUp @show='show' :arr='arr' :show='isShow'></PopUp>
</div>
</template>

<script>
import TabList from "@/components/TabList.vue";
import PopUp from "@/components/PopUp.vue";
export default {
  components: {
    TabList,
    PopUp
  },
  data() {
    return {
      records: [
        {
          date: "2022-01-01",
          doctor: "张三",
          diagnosis: "感冒",
          prescription: "感冒药",
        },
        {
          date: "2022-02-01",
          doctor: "李四",
          diagnosis: "头疼",
          prescription: "止疼药",
        },
        {
          date: "2022-03-01",
          doctor: "王五",
          diagnosis: "腰痛",
          prescription: "止痛贴",
        },
      ],
      isShow:false,
      arr:''
    };
  },
  methods:{
    look(value) {
      this.isShow = true
      this.arr = this.records.filter(ele => ele.doctor === value )[0]
    },
    show(value) {
      this.isShow = value
    }
  }
 
};
</script>

<style>
</style>